using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace Colman.Rpg.Controls
{
    /// <summary>
    /// Represents a clickable menu option.
    /// </summary>
    [DefaultEvent("Click")]
    public partial class MenuOption : UserControl
    {
        /// <summary>
        /// Creates a new instance of <see cref="MenuOption" />.
        /// </summary>
        public MenuOption()
        {
            InitializeComponent();
        }

        private void lblText_MouseEnter(object sender, EventArgs e)
        {
            this.pbHand.Visible = true;
        }

        private void lblText_MouseLeave(object sender, EventArgs e)
        {
            this.pbHand.Visible = false;
        }

        private void lblText_Click(object sender, EventArgs e)
        {
            if (this.Enabled)
                this.OnClick(e);
        }

        /// <summary>
        /// Gets or sets the text associated with this control.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Always)]
        [Browsable(true)]
        [Bindable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        public override string Text
        {
            get
            {
                return this.lblText.Text;
            }
            set
            {
                this.lblText.Text = value;
            }
        }
    }
}
